<template>
	<FlowDesign ref="FlowDesign" :node="node" :apiUrl="config.API_URL" v-if="visible" :readable="readable" />
</template>
<script setup name="flowBpmnImg">
	import sysFlowConfigApi from '@/api/flow/sysFlowConfigApi'
	import config from '@/config/index'
	import { onMounted } from 'vue'
	const props = defineProps({
		data: {
			type: Object,
			required: false
		}
	})
	const node = ref({})
	const visible = ref(false)
	const readable = ref(true)

	const init = async () => {
		const res = await sysFlowConfigApi.sysFlowConfigDetail({ id: props.data.flowId })
		node.value = JSON.parse(res.flowJson)
	}
	onMounted(async () => {
		await init()
		visible.value = true
	})
</script>
